#ifndef __BSP_CW32_GPIO_H__
#define __BSP_CW32_GPIO_H__

#define DEVICE_PWR_LED_GPIO CW_GPIOA
#define DEVICE_PWR_LED_PIN GPIO_PIN_4

#define DEVICE_ALARM_LED_GPIO CW_GPIOA
#define DEVICE_ALARM_LED_PIN GPIO_PIN_3

#define DEVICE_NET_LED_GPIO CW_GPIOA
#define DEVICE_NET_LED_PIN GPIO_PIN_2

#define DEVICE_DI_CHECK_GPIO CW_GPIOA
#define DEVICE_DI_CHECK_PIN GPIO_PIN_5

#define ALARM_LED_ON() DEVICE_ALARM_LED_GPIO->BSRR = DEVICE_ALARM_LED_PIN
#define ALARM_LED_OFF() DEVICE_ALARM_LED_GPIO->BRR = DEVICE_ALARM_LED_PIN

#define NET_LED_ON() DEVICE_NET_LED_GPIO->BSRR = DEVICE_NET_LED_PIN
#define NET_LED_OFF() DEVICE_NET_LED_GPIO->BRR = DEVICE_NET_LED_PIN
#define NET_LED_TOG() DEVICE_NET_LED_GPIO->TOG = DEVICE_NET_LED_PIN

#define DEVICE_GET_DI_STATE() (DEVICE_DI_CHECK_GPIO->IDR & DEVICE_DI_CHECK_PIN)

void bsp_gpio_init(void);

#endif
